package com.yanyeori.framework.core.constant;

import lombok.Getter;

import java.util.stream.Stream;

/**
 * 访问渠道
 *
 * @author chenkuan 2022/7/25
 */
@Getter
public enum ChannelEnum {
    WEB("网页端"),
    APP("移动客户端"),
    PC("桌面客户端");

    private final String desc;

    ChannelEnum(String desc) {
        this.desc = desc;
    }

    public static ChannelEnum get(String code) {
        return Stream.of(values()).filter(x -> x.name().equals(code)).findFirst().orElse(WEB);
    }
}
